<template>
    <div class="container">
        <input type="" v-model="price">
       <div v-text="totalNum"></div>
       <button v-on:click="doublePrice">计算价格</button>
        <button @click="tribPrice">计算价格*3</button>
    </div>
</template>
<script setup>
    import{ref} from "vue";
    const price = ref(30)
    const totalNum = ref(0);
    function doublePrice(){
        totalNum.value = price * 2;
    };
    function tribPrice() {
        totalNum.value = price * 3;
    }

</script>
<style scoped>
</style>